package algotithm.leetcode.tree.jianzhi55;

import algotithm.leetcode.tree.TreeNode;

/**
 * @author zhouyanxiang
 * @Date 2021-02-2021/2/26-23:19
 * @URL https://leetcode-cn.com/problems/er-cha-shu-de-shen-du-lcof/
 * @Title 剑指 Offer 55 - I. 二叉树的深度
 */
class Solution {
    public int maxDepth(TreeNode root) {
        if (root == null) {
            return 0;
        }
        return Math.max(maxDepth(root.left) , maxDepth(root.right)) + 1;
    }
}
